package com.ope.quartz.controller;

import com.ope.common.core.controller.BaseController;
import com.ope.common.core.page.TableDataInfo;
import com.ope.common.utils.DateUtils;
import com.ope.quartz.service.IOperationGuanateeService;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Date;
import java.util.List;

/**
 * 运维保障程序视图层接口
 * 
 * @author gnrx
 */
@Controller
@RequestMapping("/ope/gunrantee")
@Slf4j
public class OperationGuaranteeController extends BaseController {
    private String prefix = "monitor/online";

    @Autowired
    private IOperationGuanateeService iOperationGuanateeService;


    /**
     * 上海E文本告警功能
     *
     * @Date 2024年3月13日08:47:14
     * @Author fxr
     */
    @Scheduled(cron = "${AlarmCron}")
    public void opeGunrantee() {
        String time = DateUtils.getCurDate(DateUtils.FORMAT_STR2) + ":00";
        try {
            log.info("二区开始生成上海E文本告警功能文件" + new Date() + time);
            iOperationGuanateeService.opeGunrantee(time);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }


}
